﻿using System.Configuration;

namespace CMS.DataAccess
{
    /// <summary>
    /// The config key will been defined more clear so read config or database later code
    /// </summary>
    public static class ConfigureKeys
    {
        /// <summary>
        /// Gets connection string, with name in default is "CMS"
        /// </summary>
        public static string ConnectionStringStandard
        {
            get { return ConnectionString("CMS"); }
        }

        public static string ServerEmail { get; set; }

        public static string PortEmail { get; set; }

        /// <summary>
        /// Get connection string, with name exits config 
        /// </summary>
        /// <param name="name">
        /// The name.
        /// </param>
        public static string ConnectionString(string name)
        {
            return ConfigurationManager.ConnectionStrings[name].ToString();
        }

        /// <summary>
        /// Get value with key name
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns></returns>
        public static string GetKey(string name)
        {
            return ConfigurationManager.AppSettings[name];
        }
    }
}
